<template>
    <div>
        <h2>子组件</h2>
        <input type='number' v-model="countB" />
        <button @click="childadd">add</button>
    </div>
</template>
<script setup>
import { ref, defineEmits } from 'vue'
const emit = defineEmits(['updateCount'])
const countB = ref(0)
const childadd = () => {
    console.log('childadd',countB.value)
    emit('updateCount', countB.value)
}
</script>